package com.jl.jlapp.mvp.activity;

import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.LayoutManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import com.jl.jlapp.R;
import com.jl.jlapp.adapter.OrderDetailsAdapter;
import com.jl.jlapp.eneity.Evaluate;
import com.jl.jlapp.utils.CustomLanearLayoutManager;
import com.jl.jlapp.utils.Tools;
import java.util.ArrayList;
import java.util.List;

public class UnderlineDetailActivity
  extends AppCompatActivity
  implements OnClickListener
{
  private static final int REQUEST_CODE_CHOOSE = 233;
  @BindView(R.id.pic_1)
  ImageView imgPic1;
  @BindView(R.id.pic_2)
  ImageView imgPic2;
  List<Evaluate> models;
  String orderNo = "";
  double payMoney = -1.0D;
  String payeeAccount = "";
  String payeeAccountDepositBank = "";
  String payeeName = "";
  String pic1 = "";
  String pic2 = "";
  int picNum = 0;
  double postageMoney = -1.0D;
  int postagePayType = -1;
  private ProgressDialog progressDialog;
  String remitterAccount = "";
  String remitterName = "";
  @BindView(R.id.rlv_order_details)
  RecyclerView rlvOrderDetails;
  int userId = 0;
  
  @OnClick({R.id.btn_return})
  public void onClick(View paramView)
  {
    finish();
  }
  
  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(R.layout.activity_underline_detail);
    ButterKnife.bind(this);
    Tools.finishAll();
    this.userId = getSharedPreferences("JLAppData", 0).getInt("userId", 0);
    Intent intent = getIntent();
    this.payMoney = intent.getDoubleExtra("payMoney", -1.0D);
    this.orderNo = intent.getStringExtra("orderNo");
    this.postageMoney = intent.getDoubleExtra("postageMoney", -1.0D);
    this.payeeName = intent.getStringExtra("payeeName");
    this.payeeAccount = intent.getStringExtra("payeeAccount");
    this.payeeAccountDepositBank = intent.getStringExtra("payeeAccountDepositBank");
    this.postagePayType = intent.getIntExtra("postagePayType", -1);
    this.remitterName = intent.getStringExtra("remitterName");
    this.remitterAccount = intent.getStringExtra("remitterAccount");
    this.picNum = intent.getIntExtra("picNum", -1);
    if ((this.payMoney != -1.0D) && (this.postageMoney != -1.0D) && (this.orderNo != null) && (!"".equals(this.orderNo)) && (this.payeeName != null) && (!"".equals(this.payeeName)) && (this.payeeAccountDepositBank != null) && (!"".equals(this.payeeAccountDepositBank)) && (this.payeeAccount != null) && (!"".equals(this.payeeAccount)) && (this.postagePayType != -1) && (this.remitterName != null) && (!"".equals(this.remitterName)) && (this.remitterAccount != null) && (!"".equals(this.remitterAccount)) && (this.picNum >= 1))
    {
      if (this.picNum == 1)
      {
        this.pic1 = intent.getStringExtra("pic1");
        if ("".equals(this.pic1)) {
          Toast.makeText(this, "页面传值错误", Toast.LENGTH_SHORT).show();
        }
      }
      if (this.payMoney >= 50000.0D)
      {
        setData();
        setAdapter();
        this.pic1 = intent.getStringExtra("pic1");
        this.pic2 = intent.getStringExtra("pic2");
        if (("".equals(this.pic1)) || ("".equals(this.pic2))) {
          Toast.makeText(this, "页面传值错误", Toast.LENGTH_SHORT).show();
        }
        return;
      }
      Toast.makeText(this, "数据错误", Toast.LENGTH_SHORT).show();
    }else {
      Toast.makeText(this, "页面传值错误", Toast.LENGTH_SHORT).show();
    }
  }
  
  public void setAdapter()
  {
    Object localObject = new CustomLanearLayoutManager(this);
    ((CustomLanearLayoutManager)localObject).setScrollEnabled(false);
    this.rlvOrderDetails.setLayoutManager((LayoutManager)localObject);
    localObject = new OrderDetailsAdapter(R.layout.item_order_details, this.models);
    this.rlvOrderDetails.setAdapter((Adapter)localObject);
  }
  
  public void setData()
  {
    this.models = new ArrayList();
    String[] arrayOfString = new String[7];
    arrayOfString[0] = "订单号：";
    arrayOfString[1] = "总支付金额：";
    arrayOfString[2] = "收款人：";
    arrayOfString[3] = "开户行：";
    arrayOfString[4] = "账号：";
    arrayOfString[5] = "汇款人姓名：";
    arrayOfString[6] = "汇款人账号：";
    String str1 = this.orderNo;
    String str2 = "¥" + this.payMoney;
    String str3 = this.payeeName;
    String str4 = this.payeeAccountDepositBank;
    String str5 = this.payeeAccount;
    String str6 = this.remitterName;
    String str7 = this.remitterAccount;
    int i = 0;
    while (i < arrayOfString.length)
    {
      Evaluate localEvaluate = new Evaluate();
      localEvaluate.setTitle(arrayOfString[i]);
      localEvaluate.setScroe(new String[] { str1, str2, str3, str4, str5, str6, str7 }[i]);
      this.models.add(localEvaluate);
      i += 1;
    }
    if ((this.picNum == 1) && (!"".equals(this.pic1)))
    {
      this.imgPic2.setVisibility(View.GONE);
      Glide.with(this).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + this.pic1).into(this.imgPic1);
    }

      this.imgPic1.setOnClickListener(new OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          Intent intent = new Intent(UnderlineDetailActivity.this, PhotoViewActivity.class);
          intent.putExtra("picUrl", UnderlineDetailActivity.this.pic1);
          UnderlineDetailActivity.this.startActivity(intent);
        }
      });
      this.imgPic2.setOnClickListener(new OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          Intent intent = new Intent(UnderlineDetailActivity.this, PhotoViewActivity.class);
          intent.putExtra("picUrl", UnderlineDetailActivity.this.pic2);
          UnderlineDetailActivity.this.startActivity(intent);
        }
      });
      if ((this.picNum == 2) && (!"".equals(this.pic1)) && (!"".equals(this.pic2)))
      {
        this.imgPic2.setVisibility(View.VISIBLE);
        Glide.with(this).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + this.pic1).into(this.imgPic1);
        Glide.with(this).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + this.pic2).into(this.imgPic2);
      }
  }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/mvp/activity/UnderlineDetailActivity.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */